@extends('admin.layout.layout', ['row' => @$page])

@section('contain')

    <div class="portlet">
        <div class="portlet-title">
            <div class="caption">
                <x-portlet-breadcrumb :page="$page"></x-portlet-breadcrumb>
            </div>
            <div class="actions">
                <div class="items">
                    <a href="/{{ request()->path() }}/create" class="btn btn-primary">{{ ts('addnew') }}</a>
                </div>
            </div>
        </div>

        <div>
            <div class="text-nowrap">
                <table class="table text-nowrap bt-table d-none">
                    <thead>
                    <tr class="order_column text-center">
                        <th>{{ ts('sequence') }}</th>
                        <th>{{ ts('JSMC') }}</th>
                        <th>{{ ts('YHS') }}</th>
                        <th>{{ ts('OPERATIONS') }}</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($data as $k => $v)
                        @if(session('hightlight') && session('hightlight.type')=='warranty' && session('hightlight.id')==$v->id)
                            <tr class="item-list table-warning">
                        @else
                            <tr class="item-list">
                        @endif
                            <td>{{ ($k + 1) }}</td>
                            <td>{{ @$v->name }}</td>
                            <td>{{ @$v->atctivUsers() }}</td>
                            <td  class="fixed-td text-center" style="width:270px">
                                @if(@$v->id > 3)
                                    <a class="btn btn-success btn-sm" href='/{{ request()->path() }}/{{ $v->id }}'>{{ ts('VIEW') }}</a>
                                    <a class="btn btn-warning btn-sm" href='/{{ request()->path() }}/{{ $v->id }}/edit'>{{ ts('xg') }}</a>
                                @endif
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>


    </div>


@endsection

@section('script')
    <script>
        $(document).ready(function () {
            $('.table.bt-table').bootstrapTable({}).removeClass('d-none')
        })
    </script>
@endsection